package com.sanpu.kxe.business.main.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.sanpu.kxe.business.main.fragment.EarningsFragment;
import com.sanpu.kxe.business.main.fragment.HomePageFragment;
import com.sanpu.kxe.business.main.fragment.MyFragment;

import java.util.ArrayList;

/**
 * Created by JianLiang on 2016/8/1.
 */
public class MainAdapter extends FragmentPagerAdapter {

    private ArrayList<Fragment> mFragments = new ArrayList<>();

    public MainAdapter(FragmentManager fm) {
        super(fm);
        mFragments.add(new HomePageFragment());
//        mFragments.add(new NewsFragment());
//        mFragments.add(new PromoteFragment());
        mFragments.add(new EarningsFragment());
//        mFragments.add(new ProfitsFragment());
        mFragments.add(new MyFragment());
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }
}
